import os
from multiprocessing import Process


def func01(name):
    print(f'hello {name}')


def process01():
    """
    Process类简单示例
    :return:
    """
    p = Process(target=func01, args=('bob',))
    p.start()
    p.join()


def info(title):
    print(title)
    print('module name: ', __name__)
    print('parent process: ', os.getppid())
    print('process id: ', os.getpid())


def func02(name):
    info('function func02')
    print('hello ', name)


def process02():
    info('main line')
    p = Process(target=func02, args=('bob',))
    p.start()
    p.join()


if __name__ == '__main__':
    # process01()
    process02()

